package com.superlistaportable.selectSupermarket;

import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;

import com.superlistaportable.productList.ProductListActivity;

public class SelectSupermarketController{
	
	private final SelectSupermarketView view;
	private final SelectSupermarketModel model;
	private final SelectSupermarketActivity activity;
	
    public SelectSupermarketController(SelectSupermarketModel m, SelectSupermarketView v, SelectSupermarketActivity a) {
    	model = m;
    	view = v;
    	activity = a;
    }
    
public void setListeners() {
		
		view.getButtonCoto().setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(activity, ProductListActivity.class);
				intent.putExtra("selectedSupermarket","coto");
		    	activity.startActivity(intent);
			}
		});
		
		view.getButtonJumbo().setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(activity, ProductListActivity.class);
				intent.putExtra("selectedSupermarket","jumbo");
		    	activity.startActivity(intent);
			}
		});
	}

}
